package one.stand.mapper;

import one.stand.model.CompanyCouponModel;
import one.stand.model.UserCouponModel;
import one.stand.request.CoupponRecordsRequest;
import one.stand.request.UserCouponRequest;
import one.stand.response.UserCouponResponse;

import java.util.List;

public interface UserCouponMapper {
    int deleteByPrimaryKey(Long userCouponId);

    int insertSelective(UserCouponModel record);

    UserCouponModel selectByPrimaryKey(Long userCouponId);

    int updateByPrimaryKeySelective(UserCouponModel record);


    /**
     * 更新单号
     * @param record
     * @return
     */
    int updateOrderNum(UserCouponModel record);

    /**
     * 获取用户的优惠券
     * @param inModel
     * @return
     */
    List<UserCouponResponse> selectListByUserId(UserCouponModel inModel);

    /**
     * 获取用户在该公司未领取的优惠券
     * @param inModel
     * @return
     */
    List<CompanyCouponModel> selectListByCompanyIdAndNotInCouponId(UserCouponModel inModel);

    /**
     * 查询用户未使用的优惠券
     * @param inModel
     * @return
     */
    List<CompanyCouponModel> selectUserCouponNotUsed(UserCouponModel inModel);

    /**
     *
     * @param model
     * @return
     */
    List<UserCouponModel> coupponRecordsList(CoupponRecordsRequest model);

    /**
     * 查询优惠券是否被领取
     * @param userCouponModel
     * @return
     */
    UserCouponModel queryUserCoupon(UserCouponModel userCouponModel);

    UserCouponModel selectOrderNo(String ordersNo);

    List<UserCouponModel> queryAll();

//    int coupponRecordsListCount(UserCouponModel model);
}
